function columns(_this) {
  let vm = _this
  let head = [{
      title: '执行周期',
      key: 'executionCycle',
      minWidth: 250,
      fixed: 'left',
      tree: true,
      render: (h, params) => {
        return h(
          'div', {
            style: {
              color: '#2d8cf0',
              cursor: 'pointer',
            },
            on: {
              click: (e) => {
                vm.checkDetail(params.row)
              },
            },
          }, params.row.executionCycle)
      }
    },
    {
      title: '线索',
      align: 'center',
      children: [{
          title: '目标',
          key: 'clueTarget',
          minWidth: 150,
          render: (h, params) => {
            return h('div', vm.$tool.formatNumtoLocaleString(params.row.clueTarget))
          },
        },
        {
          title: '实际',
          key: 'clueReach',
          minWidth: 150,
          render: (h, params) => {
            return h('div', vm.$tool.formatNumtoLocaleString(params.row.clueReach))
          },
        },
        {
          title: '达成率（%）',
          key: 'clueProportion',
          minWidth: 150,
          render: (h, params) => {
            return h('div', params.row.clueProportion)
          },
        },
      ]
    },
    {
      title: '来人',
      align: 'center',
      children: [{
          title: '目标',
          key: 'visitTarget',
          minWidth: 150,
          render: (h, params) => {
            return h('div', vm.$tool.formatNumtoLocaleString(params.row.visitTarget))
          },
        },
        {
          title: '实际',
          key: 'visitReach',
          minWidth: 150,
          render: (h, params) => {
            return h('div', vm.$tool.formatNumtoLocaleString(params.row.visitReach))
          },
        },
        {
          title: '达成率（%）',
          key: 'visitProportion',
          minWidth: 150,
          render: (h, params) => {
            return h('div', params.row.visitProportion)
          },
        },
      ]
    },
    {
      title: '认购套数',
      align: 'center',
      children: [{
          title: '目标',
          key: 'subscribeTarget',
          minWidth: 150,
          render: (h, params) => {
            return h('div', vm.$tool.formatNumtoLocaleString(params.row.subscribeTarget))
          },
        },
        {
          title: '实际',
          key: 'subscribeReach',
          minWidth: 150,
          render: (h, params) => {
            return h('div', vm.$tool.formatNumtoLocaleString(params.row.subscribeReach))
          },
        },
        {
          title: '达成率（%）',
          key: 'subscribeProportion',
          minWidth: 150,
          render: (h, params) => {
            return h('div', params.row.subscribeProportion)
          },
        },
      ]
    },
    {
      title: '签约套数',
      align: 'center',
      children: [{
          title: '目标',
          key: 'signTarget',
          minWidth: 150,
          render: (h, params) => {
            return h('div', vm.$tool.formatNumtoLocaleString(params.row.signTarget))
          },
        },
        {
          title: '实际',
          key: 'signReach',
          minWidth: 150,
          render: (h, params) => {
            return h('div', vm.$tool.formatNumtoLocaleString(params.row.signReach))
          },
        },
        {
          title: '达成率（%）',
          key: 'signProportion',
          minWidth: 150,
          render: (h, params) => {
            return h('div', params.row.signProportion)
          },
        },
      ]
    },
    {
      title: '签约面积（m²）',
      align: 'center',
      children: [{
          title: '目标',
          key: 'areaTarget',
          minWidth: 150,
          render: (h, params) => {
            return h('div', vm.$tool.formatNumtoLocaleString(params.row.areaTarget))
          },
        },
        {
          title: '实际',
          key: 'areaReach',
          minWidth: 150,
          render: (h, params) => {
            return h('div', vm.$tool.formatNumtoLocaleString(params.row.areaReach))
          },
        },
        {
          title: '达成率（%）',
          key: 'areaProportion',
          minWidth: 150,
          render: (h, params) => {
            return h('div', params.row.areaProportion)
          },
        },
      ]
    },
    {
      title: '签约金额（元）',
      align: 'center',
      children: [{
          title: '目标',
          key: 'sumTarget',
          minWidth: 150,
          render: (h, params) => {
            return h('div', vm.$tool.formatNumtoLocaleString(params.row.sumTarget))
          },
        },
        {
          title: '实际',
          key: 'sumReach',
          minWidth: 150,
          render: (h, params) => {
            return h('div', vm.$tool.formatNumtoLocaleString(params.row.sumReach))
          },
        },
        {
          title: '达成率（%）',
          key: 'sumProportion',
          minWidth: 150,
          render: (h, params) => {
            return h('div', params.row.sumProportion)
          },
        },
      ]
    },
    {
      title: '签约理论收入（元）',
      key: 'singTheorySum',
      minWidth: 150,
      render: (h, params) => {
        return h('div', vm.$tool.formatNumtoLocaleString(params.row.singTheorySum))
      },
    },
    {
      title: '营销成本',
      align: 'center',
      children: [{
          title: '目标',
          key: 'marketingCostTarget',
          minWidth: 150,
          render: (h, params) => {
            return h('div', vm.$tool.formatNumtoLocaleString(params.row.marketingCostTarget))
          },
        },
        {
          title: '实际',
          key: 'marketingCostReach',
          minWidth: 150,
          render: (h, params) => {
            return h('div', vm.$tool.formatNumtoLocaleString(params.row.marketingCostReach))
          },
        },
        {
          title: '成本占比（%）',
          key: 'marketingCostProportion',
          minWidth: 150,
          render: (h, params) => {
            return h('div', params.row.marketingCostProportion)
          },
        },
      ]
    },
    {
      title: '回款金额（元）',
      key: 'weekReturnAmount',
      minWidth: 150,
      render: (h, params) => {
        return h('div', vm.$tool.formatNumtoLocaleString(params.row.weekReturnAmount))
      },
    },
    {
      title: '联代签约套数',
      key: 'joinSignNumber',
      minWidth: 150,
      render: (h, params) => {
        return h('div', vm.$tool.formatNumtoLocaleString(params.row.joinSignNumber))
      },
    },
  ]
  return head
}

function detailColumns() {
  let commonColumn = [{
      prop: 'customSource',
      label: '客户来源',
      width: 120,
    },
    {
      prop: 'sourceType',
      label: '来源方式',
      width: 150,
    },
    {
      prop: 'targetClue',
      label: '目标线索',
      width: 130,
    },
    {
      prop: 'targetVisit',
      label: '目标来人',
      width: 130,
    },
    {
      prop: 'targetSign',
      label: '目标签约套数',
      width: 130,
    }, {
      prop: 'targetSignArea',
      label: '目标签约面积（m²）',
      width: 200,
      render: (h, params) => {
        return h('div',
          vm.$tool.formatterMoney(params.row.targetSignArea)
        )
      },
    },
    {
      prop: 'targetSignAmount',
      label: '目标签约金额（元）',
      width: 200,
      render: (h, params) => {
        return h('div',
          vm.$tool.formatterMoney(params.row.targetSignAmount)
        )
      },
    },
    {
      prop: 'signTheoryIncome',
      label: '签约理论收入（元）',
      width: 200,
      render: (h, params) => {
        return h('div',
          vm.$tool.formatterMoney(params.row.signTheoryIncome)
        )
      },
    },
    {
      prop: 'targetMarketCost',
      label: '营销成本（元）',
      width: 200,
      render: (h, params) => {
        return h('div',
          vm.$tool.formatterMoney(params.row.targetMarketCost)
        )
      },
    },
    {
      prop: 'realClue',
      label: '实际线索',
      width: 150,
    },
    {
      prop: 'realVisit',
      label: '实际来人',
      width: 150,
    },
    {
      prop: 'realSubscribe',
      label: '实际认购套数',
      width: 150,
    },
    {
      prop: 'realSign',
      label: '实际签约套数',
      width: 150,
    },
    {
      prop: 'realSignArea',
      label: '实际签约面积（m²）',
      width: 150,
      render: (h, params) => {
        return h('div',
          vm.$tool.formatterMoney(params.row.realSignArea)
        )
      },
    },
    {
      prop: 'realSignAmount',
      label: '实际签约金额（元）',
      width: 150,
      render: (h, params) => {
        return h('div',
          vm.$tool.formatterMoney(params.row.realSignAmount)
        )
      },
    },
    {
      prop: 'realMarketCostAmount',
      label: '实际营销成本（元）',
      width: 150,
      render: (h, params) => {
        return h('div',
          vm.$tool.formatterMoney(params.row.realMarketCostAmount)
        )
      },
    }
  ]
  return commonColumn
}
export default {
  columns,
  detailColumns
}